<?
ob_start(); 
include('data/mysql_config.php');
$tablepre=tablepre;
define('charset','<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
$dbh = @mysql_connect(dbhost,dbuser,dbpass);
if(!$dbh){die("error");}
@mysql_select_db(dbname, $dbh);
//数据库连接
mysql_query("SET NAMES 'utf8'"); 
mysql_query("SET CHARACTER_SET_CLIENT=utf8"); 
mysql_query("SET CHARACTER_SET_RESULTS=utf8"); 
date_default_timezone_set(PRC);
define('datetime',date('Y-m-d H:i:s'));
define('filetime',date('YmdHis'));
define('systemname','HOLDYES EDMS');
define('version','1.5');
include('include/db.php');

$arrnowpath = explode ( "/",$_SERVER['PHP_SELF'] );
$nowpage = array_pop( $arrnowpath );
//当前网页
$unit = $db->select("SELECT value FROM `".tablepre."config` where id = '4'");
$sitelanguage='cn';
include('language/'.$sitelanguage.'/http_out.php');
function errorchars($value){
	$errorchars=array('and','select','update','chr','delete','%20from',';','insert','mid','master','set');
	foreach($value as $v){
	foreach($errorchars as $v2){
		return $v==$v2?exit('<script>alert("'.SITE_WARNING_STRING.'");  history.go(-1);</script>'):'';
		}
	}
	}
class getIP{  
 function clientIP(){  
  $cIP = getenv('REMOTE_ADDR');  
  $cIP1 = getenv('HTTP_X_FORWARDED_FOR');  
  $cIP2 = getenv('HTTP_CLIENT_IP');  
  $cIP1 ? $cIP = $cIP1 : null;  
  $cIP2 ? $cIP = $cIP2 : null;  
  return $cIP;  
 }  
 function serverIP(){  
  return gethostbyname($_SERVER_NAME);  
 }  
}  
   
$getIP  = new getIP();  
$clientIp = getIP::clientIP();  
$serverIp = getIP::serverIP();  
//ip
?>